//
//  YKTextField.m
//  ykView
//
//  Created by HuangSui on 2017/8/11.
//  Copyright © 2017年 Demo. All rights reserved.
//

#import "YKTextField.h"

@implementation YKTextField
//图片距离左边10
-(CGRect)leftViewRectForBounds:(CGRect)bounds
{
    
    CGRect rect=[super leftViewRectForBounds:bounds];
    
    
    rect.origin.x = 10;
    return rect;
}

-(CGRect)textRectForBounds:(CGRect)bounds
{
    CGRect rect=[super textRectForBounds:bounds];
    rect.origin.x = 20+self.leftView.bounds.size.width;
    return rect;
}
-(CGRect)editingRectForBounds:(CGRect)bounds
{
    CGRect rect=[super editingRectForBounds:bounds];
    rect.origin.x = 20+self.leftView.bounds.size.width;
    return rect;
}




- (CGRect)placeholderRectForBounds:(CGRect)bounds;
{
    CGRect rect=[super placeholderRectForBounds:bounds];
    rect.origin.x = 20+self.leftView.bounds.size.width;
    return rect;
}

- (CGRect)rightViewRectForBounds:(CGRect)bounds
{
    CGRect rect=[super rightViewRectForBounds:bounds];
    rect.origin.x = SCREEN_WIDTH-self.rightView.bounds.size.width-20;
    return rect;
}



@end
